<h:panelGrid xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:ap="http://aplikata.com/facelets" width="100%" cellpadding="5">

	<p:toolbar>
		<p:toolbarGroup align="right">
			<p:commandLink title="#{msgs.button_add}" styleClass="ui-icon ui-icon-circle-plus" type="image"
				actionListener="#{evokPatientTherapyBean.addReservation}" update="tblReservationList" />
		</p:toolbarGroup>
	</p:toolbar>
	<p:dataTable var="lo" value="#{evokPatientTherapyBean.therapyReservationList}"
		id="tblReservationList">
		<h:inputHidden value="#{evokPatientTherapyBean.patientTherapy.id}" />
		<p:ajax event="rowEdit" update=":mainform:tabviewTherapy:tblReservationList,:messages, :mainform:therapylist"
			listener="#{evokPatientTherapyBean.rowEditReservation}" />

		<p:column headerText="#{msgs.default_from}">
			<p:cellEditor>
				<f:facet name="output">
					<h:outputText value="#{lo.timeFrom}" converter="dateTimeConverter" />
				</f:facet>
				<f:facet name="input">
					<p:calendar value="#{lo.timeFrom}" timeZone="Europe/Zagreb" pattern="dd/MM/yyyy HH:mm"
						showOn="button" />
				</f:facet>
			</p:cellEditor>
		</p:column>
		<p:column headerText="#{msgs.default_to}">
			<p:cellEditor>
				<f:facet name="output">
					<h:outputText value="#{lo.timeTo}" converter="dateTimeConverter" />
				</f:facet>
				<f:facet name="input">
					<p:calendar value="#{lo.timeTo}" timeZone="Europe/Zagreb" pattern="dd/MM/yyyy HH:mm"
						showOn="button" />
				</f:facet>
			</p:cellEditor>
		</p:column>
		<p:column headerText="#{msgs.default_remark}" style="width:60%">
			<p:cellEditor>
				<f:facet name="output">
					<h:outputText value="#{lo.content}" />
				</f:facet>
				<f:facet name="input">
					<p:inputTextarea value="#{lo.content}" style="width:95%" rows="8" autoResize="false" />
				</f:facet>
			</p:cellEditor>
		</p:column>
		<p:column headerText="#{msgs.default_status}">
			<p:cellEditor>
				<f:facet name="output">
					<h:outputText value="#{lo.status}" converter="enumConverter" enumName="ReservationStatus" />
				</f:facet>
				<f:facet name="input">
					<p:selectOneMenu value="#{lo.status}" style="width:75px;">
						<f:selectItems value="#{sessionEnum['ReservationStatus']}" var="en" itemLabel="#{en.name}"
							itemValue="#{en.value}" />
					</p:selectOneMenu>
				</f:facet>
			</p:cellEditor>
		</p:column>

		<p:column headerText="#{msgs.table_column_operation}">
			<p:rowEditor />
			<p:commandLink style="float:right;" styleClass="ui-icon ui-icon-trash"
				oncomplete="confirmDeleteReservation.show()" title="#{msgs.button_delete}" type="image">
				<f:setPropertyActionListener value="#{lo}" target="#{evokPatientTherapyBean.schedule}" />
			</p:commandLink>
		</p:column>
	</p:dataTable>
</h:panelGrid>
